﻿<UserControl x:Class="EX_NFC.FrontEnd.Windows.Controls.DeviceLEDControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d"
             d:DesignHeight="300"
             d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <!-- ROW 0 -->
        <DataGrid  ItemsSource="{Binding LEDItems}"
                   AutoGenerateColumns="False"
                   CanUserAddRows="False"
                   CanUserDeleteRows="False"
                   CanUserReorderColumns="False"
                   CanUserSortColumns="False">
            <DataGrid.Columns>
                <DataGridTemplateColumn IsReadOnly="True"
                                        Width="80">
                    <DataGridTemplateColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="LED"
                                       HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTemplateColumn.HeaderTemplate>
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Path=Name}"
                                       HorizontalAlignment="Center"
                                       Margin="0,10,0,0" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>

                <DataGridTemplateColumn IsReadOnly="True"
                                        Width="80">
                    <DataGridTemplateColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Source={StaticResource Localizer},Path=Localize.LED_State}"
                                       HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTemplateColumn.HeaderTemplate>
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Path=State}"
                                       HorizontalAlignment="Center"
                                       Margin="0,10,0,0" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
            </DataGrid.Columns>
        </DataGrid >
        <!-- ROW 1 -->
        <Button Content="{Binding Source={StaticResource Localizer},Path=Localize.LED_SetState}"
                Command="{Binding CommandSetLEDs}"
                Grid.Row="1"
                HorizontalAlignment="Center"
                Margin="{DynamicResource BasicMargin}" />
    </Grid>
</UserControl>
